/*
 * GraphMagic, package for scientists working in graph theory.
 * Copyright (C) 2009 Dzmitry Lazerka dlazerka@dlazerka.name
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Author: Dzmitry Lazerka dlazerka@dlazerka.name
 */

package name.dlazerka.gm.basic;

import name.dlazerka.gm.Vertex;
import name.dlazerka.gm.exception.EdgeCreateException;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeNoException;
import org.junit.Test;

/**
 * @author Dzmitry Lazerka www.dlazerka.name
 */
public class BasicGraphTestPseudo {
	@Test
	public void testNonPseudo() {
		BasicGraph basicGraph = new BasicGraph(false, false, false);

		Vertex vertex1 = basicGraph.createVertex();

		try {
			basicGraph.createEdge(vertex1, vertex1);
			fail();
		} catch (EdgeCreateException e) {
			// expected
		}
	}

	@Test
	public void testPseudo() {
		BasicGraph basicGraph = new BasicGraph(false, false, true);

		Vertex vertex1 = basicGraph.createVertex();

		try {
			basicGraph.createEdge(vertex1, vertex1);
		} catch (EdgeCreateException e) {
			assumeNoException(e);
		}
	}
}
